/**
 * Copyright(c) 2010 Ceno Techonologies Co., Ltd.
 *
 * History:
 *   15-7-2 下午12:28 Created by lyyang
 */
package com.xunton.bss.weixin.api.bonus.request;

import java.util.UUID;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * 红包查询请求
 *
 * @author <a href="mailto:lyyang@ceno.cn">lyyang</a>
 * @version 1.0 15-7-2 下午12:28
 */
@XmlRootElement (name = "xml")
@XmlAccessorType (XmlAccessType.FIELD)
public class QueryRecordRequest extends Request
{
   @XmlElement (name = "nonce_str")
    private String nonceStr;

    @XmlElement (name = "mch_billno")
    private String orderNo;

    @XmlElement (name = "appid")
    private String appId;

    @XmlElement (name = "mch_id")
    private String mchId;

    @XmlElement (name = "bill_type")
    private String billType = "MCHT";

    public String getMchId()
    {
        return mchId;
    }

    public void setMchId(String mchId)
    {
        params.put("mch_id",mchId);
        this.mchId = mchId;
    }

    public String getBillType()
    {
        return billType;
    }

    public String getNonceStr()
    {
        return nonceStr;
    }

    public void setNonceStr(String nonceStr)
    {
        params.put("nonce_str",nonceStr);
        this.nonceStr = nonceStr;
    }

    public String getOrderNo()
    {
        return orderNo;
    }

    public void setOrderNo(String orderNo)
    {
        params.put("mch_billno",orderNo);
        this.orderNo = orderNo;
    }

    public String getAppId()
    {
        return appId;
    }

    public void setAppId(String appId)
    {
        params.put("appid",appId);
        this.appId = appId;
    }

    public QueryRecordRequest(){
        nonceStr = UUID.randomUUID().toString().replace("-","");
        if (nonceStr.length()>32){
            nonceStr = nonceStr.substring(0,32);
        }
        params.put("nonce_str",nonceStr);
        params.put("bill_type",billType);
    }
}
